// 1. 导入
import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router'

// 2. 创建路由对象
const router = createRouter({
  history: createWebHistory(),
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      component: () => import('@/views/home.vue')
    },
    {
      path: '/volar',
      component: () => import('@/views/pages/volar.vue')
    },
    {
      path: '/personal-card',
      component: () => import('@/views/pages/my/personal-card/index.vue')
    }
  ]
})
router.beforeEach((to, from, next) => {
  next()
})

// 3. 导出
export default router
